<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="include/base.jsp" %>
<!DOCTYPE HTML>
<html>
<head>
	<meta charset="UTF-8">
	<title>document</title>
	<link rel="stylesheet" href="css/bootstrap.min.css" />
	<link rel="stylesheet" href="css/style.css" />
	<link rel="stylesheet" href="css/redactor.css" />
</head>
<body>
	<div class="container">
	<%@ include file="include/top.jsp" %>
	<!--header end-->
		<div class="content">
			<div class="row">
				<div class="span9">
					<div class="document">
						<ul>
							<li><a href=""><i class="icon-folder-open"></i>资料</a></li>
							<li class="pull-right"><a href="adddocument.jspx"><i class="icon-plus"></i>分享新资料</a></li>
						</ul>
					</div>
					<div class="wall">
						<br/>
						<form class="form-horizontal" method="post" action="documentedit.jspx">
							<div class="control-group">
								<label class="control-label">资料标题</label>
								<div class="controls">
									<input type="hidden" name="id" value="${document.id }"/>
									<input type="text" name="title" value="${document.title }" class="span5">
								</div>
							</div>
							<br/>
							<div class="control-group">
								<label class="control-label">资料内容</label>
								<div class="controls">
									<textarea name="content" class="redactor-text">"${document.content }"</textarea>
								</div>
							</div>
							<div class="form-actions">
								<button type="button" class="btn btn-primary" id="save">保存</button>
								<button type="button" class="btn" id="return">返回</button>
							</div>
						</form>
					</div>
				</div>
				<div class="span3">
				</div>
			</div>
		</div>
		<!--container end-->
		<div class="footer">
			<p>Copyright © 2013 xxx版权所有</p>
		</div>
		<!--footer end-->
	</div>
	
	<script type="text/javascript" src="js/jquery.js"></script>
	<script type="text/javascript" src="js/bootstrap.min.js"></script>
		<script type="text/javascript" src="js/zh_cn.js"></script>
	<script type="text/javascript" src="js/redactor.js"></script>
	<script type="text/javascript">
		$(function(){
			$(".redactor-text").redactor({
				lang:'zh_cn',
				buttons: [ 'bold', 'italic', 'deleted', '|',
	    'unorderedlist', 'orderedlist', 'outdent', 'indent', '|', 'link', '|','fontcolor', 'backcolor', '|', 'alignment', '|', 'horizontalrule']			
			});
			$("#save").click(function(){
				$(".form-horizontal").submit();
			});
			$("#return").click(function(){
				window.location="documentlist.jspx";
			});
		});
	</script>
</body>
</html>